From b1eda448295c341f1b75dc1b8e5300fa19b6ffcd Mon Sep 17 00:00:00 2001 From: tsteven4 Date: Sat, 23 Feb 2013 22:20:03 +0000 Subject: [PATCH] Fix invalid output with "-o gpx,garminextensions=1" and the new gpx writer. There are still lots of issues with garmin extensions if the input and output are both gpx. --- gpsbabel/gpx.cc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/gpsbabel/gpx.cc b/gpsbabel/gpx.cc index 0369ac22f..79e0b9630 100644 --- a/gpsbabel/gpx.cc +++ b/gpsbabel/gpx.cc @@ -2233,12 +2233,18 @@ gpx_write(void) #if OLDGPX gbfprintf(ofd, " xmlns:h=\"http://humminbird.com\"\n"); #else - writer.writeAttribute("\n xmlns:h","http://humminbird.com"); + writer.writeAttribute("\n xmlns:h","http://humminbird.com"); #endif } - if (opt_garminext) + if (opt_garminext) { +#if OLDGPX gbfprintf(ofd, " xmlns:gpxx=\"http://www.garmin.com/xmlschemas/GpxExtensions/v3\"\n" " xmlns:gpxtpx=\"http://www.garmin.com/xmlschemas/TrackPointExtension/v1\"\n"); +#else + writer.writeAttribute("\n xmlns:gpxx", "http://www.garmin.com/xmlschemas/GpxExtensions/v3"); + writer.writeAttribute("\n xmlns:gpxtpx", "http://www.garmin.com/xmlschemas/TrackPointExtension/v1"); +#endif + } #if OLDGPX gbfprintf(ofd, " xmlns=\"http://www.topografix.com/GPX/%c/%c\"\n", gpx_wversion[0], gpx_wversion[2]); #else @@ -2248,7 +2254,7 @@ gpx_write(void) #if OLDGPX gbfprintf(ofd, " xsi:schemaLocation=\"%s\">\n", xsi_schema_loc); #else - writer.writeAttribute("\n xsi:schemaLocation", xsi_schema_loc); + writer.writeAttribute("\n xsi:schemaLocation", xsi_schema_loc); #endif } else { #if OLDGPX -- 2.30.2